{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2024-02-03T07:22:19.426530Z",
     "start_time": "2024-02-03T07:22:19.401136Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "3"
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 字符串的常用方法\n",
    "\"xyzxyzxyz\".count('x')"
   ]
  },
  {
   "cell_type": "code",
   "outputs": [
    {
     "data": {
      "text/plain": "2"
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"xyzxyzxz\".count('xy')"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-02-03T07:22:58.013850Z",
     "start_time": "2024-02-03T07:22:58.009251Z"
    }
   },
   "id": "1e6e09991668071f",
   "execution_count": 3
  },
  {
   "cell_type": "code",
   "outputs": [
    {
     "data": {
      "text/plain": "0"
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"xyzxyzxz\".count('a')"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-02-03T07:23:17.524578Z",
     "start_time": "2024-02-03T07:23:17.517065Z"
    }
   },
   "id": "94d8d250c1c5e378",
   "execution_count": 4
  },
  {
   "cell_type": "code",
   "outputs": [
    {
     "data": {
      "text/plain": "True"
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"xyzxyzxz\".isalnum()"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-02-03T07:24:07.812975Z",
     "start_time": "2024-02-03T07:24:07.804688Z"
    }
   },
   "id": "4ccc9b9fd470a639",
   "execution_count": 5
  },
  {
   "cell_type": "code",
   "outputs": [
    {
     "data": {
      "text/plain": "True"
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"xyzxyzxz\".isalpha()"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-02-03T07:24:44.840460Z",
     "start_time": "2024-02-03T07:24:44.836713Z"
    }
   },
   "id": "24f376cf346441f7",
   "execution_count": 6
  },
  {
   "cell_type": "code",
   "outputs": [
    {
     "data": {
      "text/plain": "'a,b,c,d,e,f,g'"
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\",\".join(\"abcdefg\")"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-02-03T07:25:33.923505Z",
     "start_time": "2024-02-03T07:25:33.911174Z"
    }
   },
   "id": "1c0d45af66e20ac3",
   "execution_count": 8
  },
  {
   "cell_type": "code",
   "outputs": [
    {
     "data": {
      "text/plain": "['a', 'b', 'c', 'd']"
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"a,b,c,d\".split(\",\")"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-02-03T07:26:05.228807Z",
     "start_time": "2024-02-03T07:26:05.220950Z"
    }
   },
   "id": "5dfa6369aab855e1",
   "execution_count": 9
  },
  {
   "cell_type": "code",
   "outputs": [
    {
     "data": {
      "text/plain": "False"
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"xyz\".startswith(\"y\")"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-02-03T07:27:56.092743Z",
     "start_time": "2024-02-03T07:27:56.080121Z"
    }
   },
   "id": "9621d3181af4589",
   "execution_count": 11
  },
  {
   "cell_type": "code",
   "outputs": [
    {
     "data": {
      "text/plain": "3"
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"Beautiful is better than ugly.Explicit is better than implicit.Simple is better than complex.\".count(\"better\")"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-02-03T07:29:10.088908Z",
     "start_time": "2024-02-03T07:29:10.084898Z"
    }
   },
   "id": "26181cb15e51dd00",
   "execution_count": 12
  },
  {
   "cell_type": "code",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hello ROSE\n"
     ]
    }
   ],
   "source": [
    "username = input(\"Enter your name\")\n",
    "print(\"Hello \" + username.upper())"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-02-03T07:31:05.017633Z",
     "start_time": "2024-02-03T07:31:00.880509Z"
    }
   },
   "id": "574369842c60a87f",
   "execution_count": 15
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
